<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>art模板引擎测试</title>
		<script src="https://unpkg.com/art-template@4.13.2/lib/template-web.js" type="text/javascript" charset="utf-8"></script>
		<script>
			window.onload = function(){
				//获取数据
				var data = {title:"这是标题",cont:"这是内容",doc:"https://aui.github.io/art-template/zh-cn/docs/installation.html"};
				//获取模板并解析
				var html1 = template("tpl1" , data),
					html2 = template("tpl2" , data);
				//渲染
				document.getElementById("container").innerHTML = html1
				document.getElementById("cont").innerHTML = html2
			}
		</script>
	</head>
	<body>
		<div id="container">
			<!-- 自定义模版 -->
			<script id="tpl1" type="text/html">
				<h1>{{title}}</h1>
			</script>
		</div>
		<div id="cont">
			<!-- 自定义模版 -->
			<script id="tpl2" type="text/html">
				<h2>{{cont}}</h2>
				<a target="_blank" href="{{doc}}">art-template模板引擎说明文档</a>
			</script>
		</div>
	</body>
</html>
